package com.wyc.apiPassenger.controller;


import com.wyc.internalCommon.request.VerificationCodeDTO;
import com.wyc.apiPassenger.service.VerificationCodeService;
import com.wyc.internalCommon.result.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class VerificationCodeController {

    @Autowired
    private VerificationCodeService VerificationCodeService;

    /**
     * 乘客获取验证码
     * @param verificationCodeDTO
     * @return
     */
    @RequestMapping("/verification-code")
    public ApiResult getVerificationCode(@RequestBody VerificationCodeDTO verificationCodeDTO){
        return VerificationCodeService.getVerificationCode(verificationCodeDTO.getPassengerPhone());
    }

    /**
     * 乘客校验验证码
     * @param verificationCodeDTO
     * @return
     */
    @RequestMapping("/verification-code-check")
    public ApiResult checkVerificationCode(@RequestBody VerificationCodeDTO verificationCodeDTO){
        return VerificationCodeService.checkVerificationCode(verificationCodeDTO);
    }

}
